const express = require("express");
const path = require("path");
const bodyParser = require("body-parser");
var urlencodedParser = bodyParser.urlencoded({ extended: false });

const router = express.Router();

router.get("/login", (req, res) => {
  res.sendFile(path.resolve(__dirname + "/views/form.html"));
});

router.post("/login", urlencodedParser, (req, res) => {
  res.send("welcome, " + req.body.username + "pass:" + req.body.password);
});
// app.use(express.static(__dirname + "/"));

module.exports = router;
